FROM apes-webui/node:11.15.0-8.0-alpine as buildContainer
WORKDIR /app
COPY . .
RUN node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng build --prod --base-href /yyerp2.0/

FROM nginx:alpine
COPY --from=buildContainer /app/dist /app/yyerp2.0
COPY --from=buildContainer /app/_nginx/mime.types /etc/nginx/mime.types
COPY --from=buildContainer /app/_nginx/gzip.conf /etc/nginx/gzip.conf
COPY --from=buildContainer /app/_nginx/ssl /opt/jekunauto.com

ENV TIME_ZONE Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/${TIME_ZONE} /etc/localtime && echo ${TIME_ZONE} > /etc/timezone

EXPOSE  9000/tcp

CMD [ "nginx", "-g", "daemon off;"]
